package com.xiaxiaoge.tutorialmod.items;

import com.xiaxiaoge.tutorialmod.TutorialMod;
import com.xiaxiaoge.tutorialmod.block.ModBlocks;
import com.xiaxiaoge.tutorialmod.entity.ModEntityTypes;
import com.xiaxiaoge.tutorialmod.items.csgo.knife.M9SkinItem;
import com.xiaxiaoge.tutorialmod.items.custom.EightBallItem;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemNameBlockItem;
import net.minecraft.world.item.SwordItem;
import net.minecraft.world.item.Tiers;
import net.minecraftforge.common.ForgeSpawnEggItem;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

/**
 * @author 夏小哥
 * @version 1.0
 */
public class ModItems {
    /**
     * 延迟注册
     */
    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, TutorialMod.MOD_ID);
    /**
     *  案例材料
     */
    public static final RegistryObject<Item> ZIRCON = ITEMS.register("zircon",
            () -> new Item(new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));
    /**
     *  案例矿石
     */
    public static final RegistryObject<Item> RAW_ZIRCON = ITEMS.register("raw_zircon",
            () -> new Item(new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));

    /**
     *  微信粑粑
     */
    public static final RegistryObject<Item> WXSHIT = ITEMS.register("wxshit",
            () -> new Item(new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));

    /**
     *  随机计数器
     */
    public static final RegistryObject<Item> EIGHT_BALL = ITEMS.register("eight_ball",
            () -> new EightBallItem(new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB).stacksTo(1)));

    /**
     * 蓝莓种子
     */
    public static final RegistryObject<Item> BLUEBERRY_SEEDS = ITEMS.register("blueberry_seeds",
            () -> new ItemNameBlockItem(ModBlocks.BLUEBERRY_CROP.get(),
                    new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));
    /**
     * 蓝莓
     */
    public static final RegistryObject<Item> BLUEBERRY = ITEMS.register("blueberry",
            () -> new Item(new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)
                    .food(new FoodProperties.Builder().nutrition(2).saturationMod(2f).build())));

    /**
     * 恐龙
     */
    public static final RegistryObject<Item> DIAMONSURD_SPAWN_EGG = ITEMS.register("diamonsurd_spawn_egg",
            () -> new ForgeSpawnEggItem(ModEntityTypes.DIAMONSURD, 0x22b341, 0x19732e,
                    new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));

    /**
     * 新雪人
     */
    public static final RegistryObject<Item> NEW_SNOW_MAN_SPAWN_EGG = ITEMS.register("newsnowman_spawn_egg",
            () -> new ForgeSpawnEggItem(ModEntityTypes.NewSnowMan, 0x223341, 0x19732e,
                    new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));

    /**
     * 新雪人
     */
    public static final RegistryObject<Item> DING_DONG_CHICKEN_SPAWN_EGG = ITEMS.register("ding_dong_chicken_egg",
            () -> new ForgeSpawnEggItem(ModEntityTypes.DING_DONG_CHICKEN, 0x223341, 0x19732e,
                    new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB)));


    /**
     *  CSGO Knife M9 Skin
     */
    public static final RegistryObject<Item> KNIFE_M9_SKIN = ITEMS.register("knife_m9_skin",
            () -> new M9SkinItem(Tiers.DIAMOND, 10, 5f,
                    new Item.Properties().tab(ModCreativeModeTab.TUTORIAL_TAB).stacksTo(1)));

    /**
     * 将事件总线参数传递
     */
    public static void register(IEventBus eventBus) {
        ITEMS.register(eventBus);
    }

}
